home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / uasm.arc / UASM-INT.BAS (.txt) < prev    next >
Encoding:
GW-BASIC  |  1986-04-20  |  9.9 KB  |  195 lines

  1. 10  '--------------------------------------------------------------------------
  2. 11  '|<UNK! {0009}>UASM-INT  1.12<UNK! {0009}><UNK! {0009}>22 Nov., 1983<UNK! {0009}><UNK! {0009}>White Crane Systems  |
  3. 12  '|<UNK! {0009}>copyright 1983<UNK! {0009}><UNK! {0009}>Guy C. Gordon<UNK! {0009}><UNK! {0009}>3194 Friar Tuck Way  |
  4. 13  '|<UNK! {0009}>  <UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}>Doraville, GA 30340  |
  5. 14  '|<UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}>     |
  6. 16  '|<UNK! {0009}>This program takes the Unassemble output from UASM-JMP and puts in   |
  7. 22  '|<UNK! {0009}>Macros for the DOS interrupts.  The Macro calls and Symbols are      |
  8. 24  '|<UNK! {0009}>contained in the companion file UASM-DOS.MAC, which contains a<UNK! {0009}>     |
  9. 26  '|<UNK! {0009}>table of Equates which may be included in the final .ASM listing.    |
  10. 27  '| <UNK! {0009}>If you modify the table to suit your needs or taste, make certain    |
  11. 30  '|<UNK! {0009}>that it meets the requirements of both this program and your<UNK! {0009}>     |
  12. 32  '|<UNK! {0009}>assembler.<UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}>     |
  13. 40  '|<UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}>     |
  14. 46  '|<UNK! {0009}>Due to the large amount of disk I/O, this program will run fastest   |
  15. 48  '|<UNK! {0009}>with the input and output files on a RAM drive.  If you must put     |
  16. 49  '|<UNK! {0009}>both files on floppies, specify separate drives for input & output.  |
  17. 50  '********************************* NOTICE *********************************
  18. 51  '*          USER SUPPORTED SOFTWARE (With thanks to Andrew Flugelman)     *
  19. 52  '*                                                                        *
  20. 53  '*   A limited license is granted to all users of this program, to make   *
  21. 54  '*   copies of this program and distribute them to other users subject    *
  22. 55  '*   to the following conditions:                                         *
  23. 56  '*           1.  None of the notices or credits are to be bypassed,       *
  24. 57  '*               altered, or removed.                                     *
  25. 58  '*           2.  The program is not to be distributed in modified form.   *
  26. 59  '*               (Users are encouraged to distribute MERGE files.)        *
  27. 60  '*           3.  No fee is to be charged (or any other consideration      *
  28. 61  '*               received) for copying or distributing the program        *
  29. 62  '*               without an express written agreement with                *
  30. 63  '*               White Crane Systems.                                     *
  31. 64  '**************************************************************************
  32. 70  CLS 'PRINT CHR$(27)+"E";   <UNK! {0009}>'CLS for IBM, ESC E for Victor 9000
  33. 71  PRINT "                                UASM-INT
  34. 72  PRINT "          White Crane Systems Unassembler - Interrupt Module
  35. 73  PRINT "
  36. 74  PRINT "           If you are using this program and finding it of value
  37. 75  PRINT "      please send  a cash contribution to support its upkeep and
  38. 76  PRINT "      distribution.   Use the UASM system  of programs to  unas-
  39. 77  PRINT "      semble one average length .COM file, look over the results
  40. 78  PRINT "      and calculate how many hours this would have taken you  to
  41. 79  PRINT "      to produce,  multiply by the minimum wage, contribute that
  42. 80  PRINT "      amount and use the programs free thereafter. If that's too
  43. 81  PRINT "      much just send $20.   Supporters will receive  free notice 
  44. 82  PRINT "      of enhancements and updates.
  45. 83  PRINT "           In any case you are encouraged to copy and distribute 
  46. 84  PRINT "      UASM to your friends provided you do so free of charge and
  47. 85  PRINT "      in unmodified form.
  48. 87  PRINT " 
  49. 88  PRINT "                          Guy C. Gordon
  50. 89  PRINT "                          White Crane Systems
  51. 90  PRINT "                          3194 Friar Tuck Way
  52. 91  PRINT "                          Doraville, GA 30340
  53. 92  PRINT " 
  54. 100  <UNK! {0009}>DEFINT A-Z: DIM SERVICE$(90), COMMENT$(90)<UNK! {0009}>'# DOS 2.00 services
  55. 110  <UNK! {0009}>TRUE=(1=1): FALSE=NOT TRUE
  56. 115  <UNK! {0009}>PRINT
  57. 120  <UNK! {0009}>INPUT "Enter name of input file [.JMP]: ", INFILE$
  58. 130  <UNK! {0009}>  DR=INSTR(INFILE$,":"): EXT=INSTR(INFILE$,".")
  59. 140  <UNK! {0009}>  IF EXT=0 THEN INFILE$=INFILE$+".JMP": EXT=INSTR(INFILE$,".")
  60. 145  <UNK! {0009}>  ID$=MID$(INFILE$,DR+1,EXT-DR-1)
  61. 150  <UNK! {0009}>PRINT "Enter name of output file ["ID$".INT]: ";: INPUT "", OUTFILE$
  62. 160  <UNK! {0009}>  IF INSTR(OUTFILE$,":")=LEN(OUTFILE$) THEN OUTFILE$=OUTFILE$+ID$
  63. 170  <UNK! {0009}>  IF INSTR(OUTFILE$,".")=0 THEN OUTFILE$=OUTFILE$+".INT"
  64. 180  <UNK! {0009}>PRINT
  65. 190  <UNK! {0009}>GOSUB 1000<UNK! {0009}><UNK! {0009}><UNK! {0009}>'Read UASM-DOS.MAC file
  66. 400  '------------------------------------------------------------------------
  67. 401  '|<UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}>READ SOURCE FILE<UNK! {0009}><UNK! {0009}><UNK! {0009}>    |
  68. 402  '------------------------------------------------------------------------
  69. 405  <UNK! {0009}>PRINT TIME$,"Reading "INFILE$: PRINT ,"Writing "OUTFILE$: PRINT
  70. 410  <UNK! {0009}>OPEN  INFILE$ FOR  INPUT AS #1
  71. 420  <UNK! {0009}>OPEN OUTFILE$ FOR OUTPUT AS #2
  72. 422  <UNK! {0009}>LINE INPUT #1,A$: PRINT #2,A$: PRINT #2,<UNK! {0009}>'skip TITLE
  73. 425  <UNK! {0009}>PRINT #2,"INCLUDE<UNK! {0009}>UASM-DOS.MAC"
  74. 430  <UNK! {0009}>WHILE NOT EOF(1)
  75. 435  <UNK! {0009}>  '<UNK! {0009}><UNK! {0009}><UNK! {0009}>Keep track of registers
  76. 440  <UNK! {0009}>  LINE INPUT #1,A$
  77. 450  <UNK! {0009}>  IF LEFT$(A$,1)="L" THEN AX$="": AH$="": AL$="": D$=""<UNK! {0009}> 'Entry point
  78. 460  <UNK! {0009}>  IF  MID$(A$,17,1)<>"A" THEN 500<UNK! {0009}>'Found defnition of A
  79. 470  <UNK! {0009}>    IF MID$(A$,18,1)="X" THEN AX$=MID$(A$,20): AH$="": AL$="": GOTO 510
  80. 480  <UNK! {0009}>    IF MID$(A$,18,1)="H" THEN AH$=MID$(A$,20): GOTO 510
  81. 490  <UNK! {0009}>    IF MID$(A$,18,1)="L" THEN AL$=MID$(A$,20): GOTO 510
  82. 500  <UNK! {0009}>  IF MID$(A$,17,2)="DX" OR MID$(A$,17,2)="DL"  THEN D$=MID$(A$,20)
  83. 510  <UNK! {0009}>  '<UNK! {0009}><UNK! {0009}><UNK! {0009}>Take care of INTerrupts
  84. 520  <UNK! {0009}>  IF MID$(A$,9,3)="INT" THEN GOSUB 2000 ELSE PRINT #2, A$
  85. 580  <UNK! {0009}>WEND<UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}>'how can I get any work done
  86. 585  <UNK! {0009}>PRINT: PRINT TIME$,"UASM-INT Complete."<UNK! {0009}>'when you keep interrupting me?
  87. 590  <UNK! {0009}>CLOSE: END<UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}>
  88. 1000  '-------------------------------------------------------------------------
  89. 1001  '|<UNK! {0009}><UNK! {0009}><UNK! {0009}>READ INTERRUPT 21 SERVICE CODES<UNK! {0009}><UNK! {0009}><UNK! {0009}>      |
  90. 1002  '-------------------------------------------------------------------------
  91. 1005  <UNK! {0009}>PRINT TIME$,"Reading UASM-DOS.MAC"
  92. 1010  <UNK! {0009}>ON ERROR GOTO 1110
  93. 1020  <UNK! {0009}>OPEN "UASM-DOS.MAC" FOR INPUT AS #1
  94. 1030  <UNK! {0009}>WHILE LEFT$(A$,6)<>";START": LINE INPUT #1,A$: WEND
  95. 1040  <UNK! {0009}>ON ERROR GOTO 0
  96. 1050  <UNK! {0009}>WHILE NOT EOF(1):
  97. 1060  <UNK! {0009}>  LINE INPUT #1,A$
  98. 1070  <UNK! {0009}>  IF LEFT$(A$,4)=";END" THEN CLOSE: RETURN
  99. 1080  <UNK! {0009}>  IF LEFT$(A$,1)=";" THEN 1100
  100. 1090  <UNK! {0009}><UNK! {0009}>SERV=VAL("&H"+MID$(A$,19,2)): SERVICE$(SERV)=LEFT$(A$,12)
  101. 1095  <UNK! {0009}><UNK! {0009}>COMMENT$(SERV)=MID$(A$,21): IF SERV>MAXSERV THEN MAXSERV=SERV
  102. 1100  <UNK! {0009}>WEND
  103. 1110  <UNK! {0009}>'<UNK! {0009}><UNK! {0009}><UNK! {0009}>locate UASM-DOS.MAC
  104. 1120  <UNK! {0009}>IF ERR<>53 THEN CLOSE: RETURN
  105. 1130  <UNK! {0009}>PRINT: PRINT "All right...."
  106. 1140  <UNK! {0009}>PRINT "Where have you put my data file? ";
  107. 1150  <UNK! {0009}>WHILE ANSWER$="": ANSWER$=INKEY$: WEND: PRINT ANSWER$":UASM-DOS.MAC"
  108. 1155  <UNK! {0009}>PRINT
  109. 1160  <UNK! {0009}>OPEN ANSWER$+":uasm-dos.mac" FOR INPUT AS #1
  110. 1180  <UNK! {0009}>RESUME NEXT
  111. 2000  '-------------------------------------------------------------------------
  112. 2001  '|<UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}>INTERRUPT<UNK! {0009}><UNK! {0009}><UNK! {0009}><UNK! {0009}>      |
  113. 2002  '-------------------------------------------------------------------------
  114. 2010  <UNK! {0009}>INTERRUPT=VAL("&H"+MID$(A$,17,2))
  115. 2020  <UNK! {0009}>IF INTERRUPT=&H21 THEN 2100
  116. 2030  <UNK! {0009}>C$=CHR$(9)+";"<UNK! {0009}>'tab
  117. 2040  <UNK! {0009}>IF (INTERRUPT < 0) OR (INTERRUPT > &H27) THEN 9800
  118. 2050  <UNK! {0009}>IF INTERRUPT = 0 THEN 5000
  119. 2060  <UNK! {0009}>ON INTERRUPT GOTO 5100,5200,5300,5400,5500,5600,5700,5800,5900,6000,6100,6200,6300,6400,6500,7000,7100,7200,7300,7400,7500,7600,7700,7800,7900,8000,8100,8200,8300,8400,8500,9000,9100,9200,9300,9400,9500,9600,9700
  120. 2070  <UNK! {0009}>GOTO 9800
  121. 2099  '-------------------------------------------------------------------------
  122. 2100  '|  <UNK! {0009}><UNK! {0009}><UNK! {0009}>Determine value of AH (service code)<UNK! {0009}>      |
  123. 2101  '-------------------------------------------------------------------------
  124. 2105  <UNK! {0009}>IF INSTR(AH$," ")>0 THEN AH$=LEFT$(AH$,INSTR(AH$," ")-1)
  125. 2110  <UNK! {0009}>IF LEN(AH$)=2 THEN AH=VAL("&H"+AH$): GOTO 2200
  126. 2115  <UNK! {0009}>IF INSTR(AX$," ")>0 THEN AX$=LEFT$(AX$,INSTR(AX$," ")-1)
  127. 2120  <UNK! {0009}>IF LEN(AX$)=4 THEN AH=VAL("&H"+LEFT$(AX$,2)): GOTO 2200
  128. 2130  <UNK! {0009}>AH=MAXSERV+1<UNK! {0009}><UNK! {0009}>'Default value (null strings)
  129. 2140  <UNK! {0009}>IF LEN(AH$)<>0 THEN X$=AH$ ELSE X$=AX$
  130. 2150  <UNK! {0009}>GOTO 2300
  131. 2200  <UNK! {0009}>X$=""<UNK! {0009}><UNK! {0009}>'Define X$ if DX or DL is loaded for this call
  132. 2210  <UNK! {0009}>IF AH=2 OR (AH>=4  AND AH<= 6) OR AH=9  OR AH=&HA THEN X$=D$: GOTO 2300
  133. 2220  <UNK! {0009}>IF ((AH>=&HE) AND (AH<=&H17)) OR AH=&H1A OR AH=&H1C THEN X$=D$:GOTO 2300
  134. 2230  <UNK! {0009}>IF ((AH>=&H21) AND (AH<=&H28)) THEN X$=D$: GOTO 2300
  135. 2240  <UNK! {0009}>IF AH=&H31 OR AH=&H33 OR AH=&H36 OR ((AH>=&H38) AND (AH<=&H3D)) THEN X$=D$
  136. 2250  <UNK! {0009}>IF AH=&H41 OR AH=&H43 OR AH=&H47 OR AH=&H4B THEN X$=D$: GOTO 2300
  137. 2260  <UNK! {0009}>IF AH=&H4B OR AH=&H56 THEN X$=D$
  138. 2300  '
  139. 2305  <UNK! {0009}>IF AH>MAXSERV+1 THEN AH=MAXSERV+1
  140. 2310  <UNK! {0009}>PRINT #2, A$
  141. 2320  <UNK! {0009}>PRINT #2,: PRINT #2,"DOSCALL ";SERVICE$(AH);X$;COMMENT$(AH)
  142. 2330  <UNK! {0009}>PRINT #2,: PRINT    "DOSCALL ";SERVICE$(AH);X$;COMMENT$(AH)
  143. 2350  <UNK! {0009}>RETURN
  144. 4000  '-----------------------------------------------------------------------
  145. 4001  '|<UNK! {0009}><UNK! {0009}><UNK! {0009}>Table of comments for each Interrupt<UNK! {0009}><UNK! {0009}>    |
  146. 4002  '-----------------------------------------------------------------------
  147. 5000  <UNK! {0009}>C$=C$+"Divide by Zero": <UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 0
  148. 5100  <UNK! {0009}>C$=C$+"Single step":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 1
  149. 5200  <UNK! {0009}>C$=C$+"Non-Maskable Interrupt (NMI)":<UNK! {0009}>GOTO 10000<UNK! {0009}>'int 2
  150. 5300  <UNK! {0009}>C$=C$+"Break Point Instruction ('CC'x)":GOTO 10000<UNK! {0009}>'int 3
  151. 5400  <UNK! {0009}>C$=C$+"Overflow":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 4
  152. 5500  <UNK! {0009}>C$=C$+"Print Screen":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 5
  153. 5600  <UNK! {0009}>C$=C$+"Reserved":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 6
  154. 5700  <UNK! {0009}>C$=C$+"Reserved":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 7
  155. 5800  <UNK! {0009}>C$=C$+"Timer (18.2 per second)":<UNK! {0009}>GOTO 10000<UNK! {0009}>'int 8
  156. 5900  <UNK! {0009}>C$=C$+"Keyboard Interrupt":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 9
  157. 6000  <UNK! {0009}>C$=C$+"Reserved":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int A
  158. 6100  <UNK! {0009}>C$=C$+"Reserved":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int B
  159. 6200  <UNK! {0009}>C$=C$+"Reserved":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int C
  160. 6300  <UNK! {0009}>C$=C$+"Reserved":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int D
  161. 6400  <UNK! {0009}>C$=C$+"Diskette Interrupt":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int E
  162. 6500  <UNK! {0009}>C$=C$+"Reserved":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int F
  163. 7000  <UNK! {0009}>C$=C$+"Video I/O Call":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 10
  164. 7100  <UNK! {0009}>C$=C$+"Equipment check":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 11
  165. 7200  <UNK! {0009}>C$=C$+"Memory check":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 12
  166. 7300  <UNK! {0009}>C$=C$+"Diskette I/O Call":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 13
  167. 7400  <UNK! {0009}>C$=C$+"RS232 I/O Call":<UNK! {0009}><UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 14
  168. 7500  <UNK! {0009}>C$=C$+"Cassette I/O Call":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 15
  169. 7600  <UNK! {0009}>C$=C$+"Keyboard I/O Call":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 16
  170. 7700  <UNK! {0009}>C$=C$+"Printer I/O Call":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 17
  171. 7800  <UNK! {0009}>C$=C$+"ROM Basic Entry Code":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 18
  172. 7900  <UNK! {0009}>C$=C$+"Boot Strap Loader":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 19
  173. 8000  <UNK! {0009}>C$=C$+"Time of Day Call":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 1A
  174. 8100  <UNK! {0009}>C$=C$+"Get Control on Keyboard Break":<UNK! {0009}>GOTO 10000<UNK! {0009}>'int 1B
  175. 8200  <UNK! {0009}>C$=C$+"Get Control on timer interrupt": GOTO 10000<UNK! {0009}>'int 1C
  176. 8300  <UNK! {0009}>C$=C$+"Pointer to video initialization table": GOTO 10000 'int 1D
  177. 8400  <UNK! {0009}>C$=C$+"Pointer to diskette parameter table":   GOTO 10000 'int 1E
  178. 8500  <UNK! {0009}>C$=C$+"Pointer to graphics Char. gen. table":  GOTO 10000 'int 1F
  179. 9000  <UNK! {0009}>C$=C$+"DOS Program Terminate":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 20
  180. 9100   <UNK! {0009}>GOTO 2100<UNK! {0009}>'DOS Function Call<UNK! {0009}><UNK! {0009}><UNK! {0009}>'int 21
  181. 9200  <UNK! {0009}>C$=C$+"DOS Terminate Address":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 22
  182. 9300  <UNK! {0009}>C$=C$+"DOS CTRL-BRK Exit Address (^C)": GOTO 10000<UNK! {0009}>'int 23
  183. 9400  <UNK! {0009}>C$=C$+"DOS Fatal Error Vector":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 24
  184. 9500  <UNK! {0009}>C$=C$+"DOS Absolute Disk read":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int 25
  185. 9600  <UNK! {0009}>C$=C$+"DOS Absolute Disk write":<UNK! {0009}>GOTO 10000<UNK! {0009}>'int 26
  186. 9700  <UNK! {0009}>C$=C$+"DOS Terminate, Fix in Storage":<UNK! {0009}>GOTO 10000<UNK! {0009}>'int 27
  187. 9800  <UNK! {0009}>C$=C$+"Unrecognized Interrupt":<UNK! {0009}><UNK! {0009}>GOTO 10000<UNK! {0009}>'int  ?
  188. 9997  '-----------------------------------------------------------------------
  189. 9998  '|<UNK! {0009}><UNK! {0009}><UNK! {0009}>Print INT instruction with comment<UNK! {0009}><UNK! {0009}>    |
  190. 9999  '-----------------------------------------------------------------------
  191. 10000  <UNK! {0009}>PRINT #2,: PRINT #2, A$;C$: PRINT #2,
  192. 10010  <UNK! {0009}>PRINT A$;C$
  193. 10020  <UNK! {0009}>RETURN
  194. 10030  <UNK! {0009}>'End of program UASM-INT
  195.